<load target="js/member_admin.js" usecdn="true" />
<load target="js/krzip_search.js" usecdn="true" />
<!--%load_js_plugin("ui.datepicker")-->
<script type="text/javascript" >
	xe.lang.deleteProfileImage = '{$lang->msg_delete_extend_form}';
	xe.lang.deleteImageMark = '{$lang->msg_delete_extend_form}';
	xe.lang.deleteImageName = '{$lang->msg_delete_extend_form}';
</script>
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
	<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form action="./" class="form" ruleset="insertAdminMember" method="post" enctype="multipart/form-data">
	<input type="hidden" name="module" value="member" />
	<input type="hidden" name="act" value="procMemberAdminInsert" />
	<input type="hidden" name="member_srl" value="{$member_srl}" />
	<input type="hidden" name="signature" value="{htmlspecialchars($member_info->signature)}" />
	<input type="hidden" name="success_return_url" value="{getUrl('act', $act)}" cond="$member_srl" />
	<input type="hidden" name="success_return_url" value="{getUrl('act', 'dispMemberAdminList')}" cond="!$member_srl" />
	<h1 class="h1" cond="$member_srl">{$lang->msg_update_member}</h1>
	<h1 class="h1" cond="!$member_srl">{$lang->msg_new_member}</h1>
	<ul>
		<li cond="$member_srl">
			<p class="q">{$identifierForm->title} <em style="color:red">*</em></p>
			<p class="a">
				<input type="hidden" name="{$identifierForm->name}" value="{$identifierForm->value}" />
				<input type="text" name="{$identifierForm->name}" value="{$identifierForm->value}" disabled="disabled" />
			</p>
		</li>
		<li cond="!$member_srl">
			<p class="q">{$identifierForm->title} <em style="color:red">*</em></p>
			<p class="a">
				<input type="text" name="{$identifierForm->name}" value="" />
			</p>
		</li>
		<li cond="$member_srl">
			<p class="q">{$lang->password} <em style="color:red">*</em></p>
			<p class="a">
				<input type="hidden" name="password" value="{$member_info->password}" />
				<input type="text" name="reset_password" value="" />
			</p>
		</li>
		<li cond="!$member_srl">
			<p class="q">{$lang->password} <em style="color:red">*</em></p>
			<p class="a">
				<input type="text" name="password" value="" />
			</p>
		</li>
		<li loop="$formTags=>$formTag">
			<p class="q">{$formTag->title}</p>
			<div class="a" cond="$formTag->name != 'signature'">{$formTag->inputTag}</div>
			<div class="a" cond="$formTag->name =='signature'">{$editor}</div>
		</li>
		<li>
			<p class="q">{$lang->allow_mailing}</p>
			<p class="a">
				<input type="radio" name="allow_mailing" id="mailingYes" value="Y" checked="checked"|cond="$member_info->allow_mailing == 'Y'"> <label for="mailingYes">{$lang->cmd_yes}</label>
				<input type="radio" name="allow_mailing" id="mailingNo" value="N" checked="checked"|cond="$member_info->allow_mailing != 'Y'" > <label for="mailingNo">{$lang->cmd_no}</label>
			</p>
		</li>
		<li>
			<p class="q">{$lang->allow_message}</p>
			<p class="a">
				<block loop="$lang->allow_message_type=>$key,$val">
					<input type="radio" name="allow_message" value="{$key}" checked="checked"|cond="$member_info->allow_message == $key || (!$member_info->member_srl && $key == 'Y')" id="allow_{$key}" /> <label for="allow_{$key}">{$val}</label>
				</block>
			</p>
		</li>
		<li>
			<p class="q">{$lang->status}</p>
			<p class="a">
				<input type="radio" name="denied" id="appoval" value="N" checked="checked"|cond="$member_info->denied != 'Y'" > <label for="appoval">{$lang->approval}</label>
				<input type="radio" name="denied" id="deny" value="Y" checked="checked"|cond="$member_info->denied == 'Y'" > <label for="deny">{$lang->denied}</label>
			</p>
		</li>
		<li>
			<p class="q"><label for="until">{$lang->limit_date}</label></p>
			<p class="a">
				<input type="hidden" name="limit_date" id="date_limit_date" value="{$member_info->limit_date}" />
				<input type="text" class="inputDate" id="until" value="{zdate($member_info->limit_date,'Y-m-d',false)}" />
				<input type="button" value="{$lang->cmd_delete}" class="dateRemover" />
				<span class="desc">{$lang->about_limit_date}</span>
			</p>
		</li>
		<li>
			<p class="q">{$lang->is_admin}</p>
			<p class="a">
				<input type="radio" name="is_admin" id="is_admin" value="Y" checked="checked"|cond="$member_info->is_admin == 'Y'" > <label for="is_admin">{$lang->cmd_yes}</label>
				<input type="radio" name="is_admin" id="not_admin" value="N" checked="checked"|cond="$member_info->is_admin != 'Y'" > <label for="not_admin">{$lang->cmd_no}</label>
			</p>
		</li>
		<li>
			<p class="q"><label for="description">{$lang->description}</label></p>
			<p class="a">
				<textarea name="description" id="description" rows="8" cols="42">{htmlspecialchars($member_info->description)}</textarea>
				<span class="desc">{$lang->about_member_description}</span>
			</p>
		</li>
		<li>
			<p class="q">{$lang->member_group}</p>
			<p class="a">
				<!--@foreach($group_list as $key=>$val)-->
					<input type="checkbox" name="group_srl_list[]" value="{$key}" id="group_{$key}" <!--@if($member_info->group_list[$key])-->checked="checked"<!--@end--> />
					<label for="group_{$key}">{$val->title}</label>
				<!--@end-->
			</p>
		</li>
	</ul>
	<div class="btnArea">
		<span class="btn medium"><input type="submit" value="{$lang->save}" /></span>
	</div>
	</table>
</form>
<script type="text/javascript">
(function($){
    $(function(){
        var option = { changeMonth: true, changeYear: true, gotoCurrent: false,yearRange:'-100:+10', dateFormat:'yy-mm-dd', onSelect:function(){

            $(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,""))}
        };
        $.extend(option,$.datepicker.regional['{$lang_type}']);
        $(".inputDate").datepicker(option);
		$(".dateRemover").click(function() {
			$(this).prevAll('input').val('');
			return false;});
    });
})(jQuery);
</script>
